package com.zuxia.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zuxia.entity.RoleMember;
import com.zuxia.mapper.RoleMemberMapper;
import com.zuxia.service.RoleMemberService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author laoli
 * @since 2024-11-17
 */
@Service
public class RoleMemberServiceImpl extends ServiceImpl<RoleMemberMapper, RoleMember> implements RoleMemberService {
    @Resource
    private RoleMemberMapper roleMemberMapper;

    @Override
    public int getRoleId(String id) {
        LambdaQueryWrapper<RoleMember> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(RoleMember::getMemberId, id);
        return roleMemberMapper.selectOne(wrapper).getRoleId();
    }
}
